package com.base.cn.platform.os.service.manage.integralgood;

import com.base.cn.platform.os.entity.integralgood.IntegralGood;
import com.base.cn.platform.os.service.FeignAuthConfig;
import com.base.cn.platform.os.service.manage.BaseService;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import java.math.BigDecimal;
import java.util.List;
import java.util.Map;

/**
 * 角色与资源权限的关联Service
 *
 * @author s.li
 * @create 2018-03-06 11:44
 */
@FeignClient(name = BaseService.appName,configuration = FeignAuthConfig.class)
public interface IntegralGoodService extends BaseService {

     String path =contextPath+"/integralGood/";


    /**
     * 保存积分兑换商品
     * @param integralGood
     * @return
     */
    @RequestMapping(path+"saveEntity")
    Map  saveEntity(@RequestBody IntegralGood integralGood);


    /**
     * 根据Id查询
     * @param id
     * @return
     */
    @RequestMapping(path+"findByIdEntity")
    Map  findByIdEntity(@RequestParam(value = "id")BigDecimal id,@RequestParam(value = "isSetShopData") boolean isSetShopData);

    /**
     *  积分兑换商品分页
     * @param currentPage
     * @param integralGood
     * @return
     */
    @RequestMapping(path+"findListPage")
    Map findListPage(@RequestParam(value = "currentPage",required = false,defaultValue = "1") int currentPage , @RequestBody IntegralGood integralGood);

    /**
     * 修改数据状态
     * @param ids  id 串
     * @param status 状态
     * @return
     */
    @RequestMapping(path+"updateStatus")
    Map updateStatus(@RequestParam("ids") String ids,@RequestParam("status") Integer status);

    /**
     * 兑换
     * @param userId
     * @param shopId
     * @return
     */
    @RequestMapping(path+"exchangeIntegralShop")
    Map exchangeIntegralShop(@RequestParam("userId") BigDecimal userId,@RequestParam("shopId") BigDecimal shopId);


    /**
     * 兑换现金
     * @param userId
     * @return
     */
    @RequestMapping(path+"redeemedCash")
    Map redeemedCash(@RequestParam("userId") BigDecimal userId,@RequestParam Integer cash);


}
